﻿using Newtonsoft.Json;
using shuatibao.Tool;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace shuatibao.Web.Subject
{
    /// <summary>
    /// SubjectList 的摘要说明
    /// </summary>
    public class SubjectList : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string requestJson = new StreamReader(context.Request.InputStream).ReadToEnd();

            Dictionary<string, string> parameters = JsonConvert.DeserializeObject<Dictionary<string, string>>(requestJson);

            List<SubjectModel> subjectList = SubjectAction.getSubjectList();
            OutSubjectListModel outlist = new OutSubjectListModel();
            SubjectListModel list = new SubjectListModel();
            list.list = subjectList;
            outlist.data = list;
            outlist.code = "200";
            outlist.msg = "";
            Utils.jsonBackManager(context, Utils.toJSON(outlist));


        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}